-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
AuditableEntityInterceptor only processing 'parent' and ignore 'child' entities? #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is your OrderLineItem class also inheriting from |
Yes, it is inheriting from BaseAuditableEntity. But it is clearly not being tracked by the DbContext. It is created in the database, however. Effectively, all that that command handler is doing, after fetching the Order and instantiating the OrderLineItem is
Followed by
And I was hoping this was enough to get the job done, and not having the command handler thinking about entities being tracked or not. |
Hi @mrhighstone |
Thanks for the reply @VipulHanda but unfortunately this won't work. It's SaveChanges that actually triggers the AuditableEntityInterceptor. |
Never mind, I resolved the issue. I had the Note to self, first dispatch domain events ;-)
|
Is it correct that the AuditableEntityInterceptor only processes 'parent' entities and ignore 'child' entities?
I'm having a parent-child relation in my application, lets say an Order holding OrderLineItems. After adding items to the list and saving the Order, the AuditableEntityInterceptor correctly updates the created and updated properties of the Order but ignores the OrderLineItems.
Is this as intended? And if so, how to also update the auditable fields of an OrderLineItem when the Order is saved?
The text was updated successfully, but these errors were encountered: